3.913 \(\int (a+b x)^n (c+d x)^2 \, dx\)

Optimal. Leaf size=78 \[ \frac{(b c-a d)^2 (a+b x)^{n+1}}{b^3 (n+1)}+\frac{2 d (b c-a d) (a+b x)^{n+2}}{b^3 (n+2)}+\frac{d^2 (a+b x)^{n+3}}{b^3 (n+3)} \]

[Out]

((b*c - a*d)^2*(a + b*x)^(1 + n))/(b^3*(1 + n)) + (2*d*(b*c - a*d)*(a + b*x)^(2
+ n))/(b^3*(2 + n)) + (d^2*(a + b*x)^(3 + n))/(b^3*(3 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.0797068, antiderivative size = 78, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067 \[ \frac{(b c-a d)^2 (a+b x)^{n+1}}{b^3 (n+1)}+\frac{2 d (b c-a d) (a+b x)^{n+2}}{b^3 (n+2)}+\frac{d^2 (a+b x)^{n+3}}{b^3 (n+3)} \]

Antiderivative was successfully verified.

[In]  Int[(a + b*x)^n*(c + d*x)^2,x]

[Out]

((b*c - a*d)^2*(a + b*x)^(1 + n))/(b^3*(1 + n)) + (2*d*(b*c - a*d)*(a + b*x)^(2
+ n))/(b^3*(2 + n)) + (d^2*(a + b*x)^(3 + n))/(b^3*(3 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 19.4181, size = 66, normalized size = 0.85 \[ \frac{d^{2} \left (a + b x\right )^{n + 3}}{b^{3} \left (n + 3\right )} - \frac{2 d \left (a + b x\right )^{n + 2} \left (a d - b c\right )}{b^{3} \left (n + 2\right )} + \frac{\left (a + b x\right )^{n + 1} \left (a d - b c\right )^{2}}{b^{3} \left (n + 1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((b*x+a)**n*(d*x+c)**2,x)

[Out]

d**2*(a + b*x)**(n + 3)/(b**3*(n + 3)) - 2*d*(a + b*x)**(n + 2)*(a*d - b*c)/(b**
3*(n + 2)) + (a + b*x)**(n + 1)*(a*d - b*c)**2/(b**3*(n + 1))

_______________________________________________________________________________________

Mathematica [A]  time = 0.124005, size = 99, normalized size = 1.27 \[ \frac{(a+b x)^{n+1} \left (2 a^2 d^2-2 a b d (c (n+3)+d (n+1) x)+b^2 \left (c^2 \left (n^2+5 n+6\right )+2 c d \left (n^2+4 n+3\right ) x+d^2 \left (n^2+3 n+2\right ) x^2\right )\right )}{b^3 (n+1) (n+2) (n+3)} \]

Antiderivative was successfully verified.

[In]  Integrate[(a + b*x)^n*(c + d*x)^2,x]

[Out]

((a + b*x)^(1 + n)*(2*a^2*d^2 - 2*a*b*d*(c*(3 + n) + d*(1 + n)*x) + b^2*(c^2*(6
+ 5*n + n^2) + 2*c*d*(3 + 4*n + n^2)*x + d^2*(2 + 3*n + n^2)*x^2)))/(b^3*(1 + n)
*(2 + n)*(3 + n))

_______________________________________________________________________________________

Maple [B]  time = 0.01, size = 159, normalized size = 2. \[{\frac{ \left ( bx+a \right ) ^{1+n} \left ({b}^{2}{d}^{2}{n}^{2}{x}^{2}+2\,{b}^{2}cd{n}^{2}x+3\,{b}^{2}{d}^{2}n{x}^{2}-2\,ab{d}^{2}nx+{b}^{2}{c}^{2}{n}^{2}+8\,{b}^{2}cdnx+2\,{b}^{2}{d}^{2}{x}^{2}-2\,abcdn-2\,ab{d}^{2}x+5\,{b}^{2}{c}^{2}n+6\,{b}^{2}cdx+2\,{a}^{2}{d}^{2}-6\,abcd+6\,{b}^{2}{c}^{2} \right ) }{{b}^{3} \left ({n}^{3}+6\,{n}^{2}+11\,n+6 \right ) }} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((b*x+a)^n*(d*x+c)^2,x)

[Out]

(b*x+a)^(1+n)*(b^2*d^2*n^2*x^2+2*b^2*c*d*n^2*x+3*b^2*d^2*n*x^2-2*a*b*d^2*n*x+b^2
*c^2*n^2+8*b^2*c*d*n*x+2*b^2*d^2*x^2-2*a*b*c*d*n-2*a*b*d^2*x+5*b^2*c^2*n+6*b^2*c
*d*x+2*a^2*d^2-6*a*b*c*d+6*b^2*c^2)/b^3/(n^3+6*n^2+11*n+6)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)^2*(b*x + a)^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.221806, size = 317, normalized size = 4.06 \[ \frac{{\left (a b^{2} c^{2} n^{2} + 6 \, a b^{2} c^{2} - 6 \, a^{2} b c d + 2 \, a^{3} d^{2} +{\left (b^{3} d^{2} n^{2} + 3 \, b^{3} d^{2} n + 2 \, b^{3} d^{2}\right )} x^{3} +{\left (6 \, b^{3} c d +{\left (2 \, b^{3} c d + a b^{2} d^{2}\right )} n^{2} +{\left (8 \, b^{3} c d + a b^{2} d^{2}\right )} n\right )} x^{2} +{\left (5 \, a b^{2} c^{2} - 2 \, a^{2} b c d\right )} n +{\left (6 \, b^{3} c^{2} +{\left (b^{3} c^{2} + 2 \, a b^{2} c d\right )} n^{2} +{\left (5 \, b^{3} c^{2} + 6 \, a b^{2} c d - 2 \, a^{2} b d^{2}\right )} n\right )} x\right )}{\left (b x + a\right )}^{n}}{b^{3} n^{3} + 6 \, b^{3} n^{2} + 11 \, b^{3} n + 6 \, b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)^2*(b*x + a)^n,x, algorithm="fricas")

[Out]

(a*b^2*c^2*n^2 + 6*a*b^2*c^2 - 6*a^2*b*c*d + 2*a^3*d^2 + (b^3*d^2*n^2 + 3*b^3*d^
2*n + 2*b^3*d^2)*x^3 + (6*b^3*c*d + (2*b^3*c*d + a*b^2*d^2)*n^2 + (8*b^3*c*d + a
*b^2*d^2)*n)*x^2 + (5*a*b^2*c^2 - 2*a^2*b*c*d)*n + (6*b^3*c^2 + (b^3*c^2 + 2*a*b
^2*c*d)*n^2 + (5*b^3*c^2 + 6*a*b^2*c*d - 2*a^2*b*d^2)*n)*x)*(b*x + a)^n/(b^3*n^3
 + 6*b^3*n^2 + 11*b^3*n + 6*b^3)

_______________________________________________________________________________________

Sympy [A]  time = 5.74074, size = 1504, normalized size = 19.28 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x+a)**n*(d*x+c)**2,x)

[Out]

Piecewise((a**n*(c**2*x + c*d*x**2 + d**2*x**3/3), Eq(b, 0)), (2*a**3*d**2*log(a
/b + x)/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2) + a**3*d**2/(2*a**3*b**3 +
 4*a**2*b**4*x + 2*a*b**5*x**2) + 4*a**2*b*d**2*x*log(a/b + x)/(2*a**3*b**3 + 4*
a**2*b**4*x + 2*a*b**5*x**2) - a*b**2*c**2/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b*
*5*x**2) + 2*a*b**2*d**2*x**2*log(a/b + x)/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b*
*5*x**2) - 2*a*b**2*d**2*x**2/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2) + 2*
b**3*c*d*x**2/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2), Eq(n, -3)), (-2*a**
2*d**2*log(a/b + x)/(a*b**3 + b**4*x) - 2*a**2*d**2/(a*b**3 + b**4*x) + 2*a*b*c*
d*log(a/b + x)/(a*b**3 + b**4*x) + 2*a*b*c*d/(a*b**3 + b**4*x) - 2*a*b*d**2*x*lo
g(a/b + x)/(a*b**3 + b**4*x) - b**2*c**2/(a*b**3 + b**4*x) + 2*b**2*c*d*x*log(a/
b + x)/(a*b**3 + b**4*x) + b**2*d**2*x**2/(a*b**3 + b**4*x), Eq(n, -2)), (a**2*d
**2*log(a/b + x)/b**3 - 2*a*c*d*log(a/b + x)/b**2 - a*d**2*x/b**2 + c**2*log(a/b
 + x)/b + 2*c*d*x/b + d**2*x**2/(2*b), Eq(n, -1)), (2*a**3*d**2*(a + b*x)**n/(b*
*3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) - 2*a**2*b*c*d*n*(a + b*x)**n/(b**3*
n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) - 6*a**2*b*c*d*(a + b*x)**n/(b**3*n**3
+ 6*b**3*n**2 + 11*b**3*n + 6*b**3) - 2*a**2*b*d**2*n*x*(a + b*x)**n/(b**3*n**3
+ 6*b**3*n**2 + 11*b**3*n + 6*b**3) + a*b**2*c**2*n**2*(a + b*x)**n/(b**3*n**3 +
 6*b**3*n**2 + 11*b**3*n + 6*b**3) + 5*a*b**2*c**2*n*(a + b*x)**n/(b**3*n**3 + 6
*b**3*n**2 + 11*b**3*n + 6*b**3) + 6*a*b**2*c**2*(a + b*x)**n/(b**3*n**3 + 6*b**
3*n**2 + 11*b**3*n + 6*b**3) + 2*a*b**2*c*d*n**2*x*(a + b*x)**n/(b**3*n**3 + 6*b
**3*n**2 + 11*b**3*n + 6*b**3) + 6*a*b**2*c*d*n*x*(a + b*x)**n/(b**3*n**3 + 6*b*
*3*n**2 + 11*b**3*n + 6*b**3) + a*b**2*d**2*n**2*x**2*(a + b*x)**n/(b**3*n**3 +
6*b**3*n**2 + 11*b**3*n + 6*b**3) + a*b**2*d**2*n*x**2*(a + b*x)**n/(b**3*n**3 +
 6*b**3*n**2 + 11*b**3*n + 6*b**3) + b**3*c**2*n**2*x*(a + b*x)**n/(b**3*n**3 +
6*b**3*n**2 + 11*b**3*n + 6*b**3) + 5*b**3*c**2*n*x*(a + b*x)**n/(b**3*n**3 + 6*
b**3*n**2 + 11*b**3*n + 6*b**3) + 6*b**3*c**2*x*(a + b*x)**n/(b**3*n**3 + 6*b**3
*n**2 + 11*b**3*n + 6*b**3) + 2*b**3*c*d*n**2*x**2*(a + b*x)**n/(b**3*n**3 + 6*b
**3*n**2 + 11*b**3*n + 6*b**3) + 8*b**3*c*d*n*x**2*(a + b*x)**n/(b**3*n**3 + 6*b
**3*n**2 + 11*b**3*n + 6*b**3) + 6*b**3*c*d*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**
3*n**2 + 11*b**3*n + 6*b**3) + b**3*d**2*n**2*x**3*(a + b*x)**n/(b**3*n**3 + 6*b
**3*n**2 + 11*b**3*n + 6*b**3) + 3*b**3*d**2*n*x**3*(a + b*x)**n/(b**3*n**3 + 6*
b**3*n**2 + 11*b**3*n + 6*b**3) + 2*b**3*d**2*x**3*(a + b*x)**n/(b**3*n**3 + 6*b
**3*n**2 + 11*b**3*n + 6*b**3), True))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.233621, size = 574, normalized size = 7.36 \[ \frac{b^{3} d^{2} n^{2} x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, b^{3} c d n^{2} x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} d^{2} n^{2} x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 3 \, b^{3} d^{2} n x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + b^{3} c^{2} n^{2} x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, a b^{2} c d n^{2} x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 8 \, b^{3} c d n x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} d^{2} n x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, b^{3} d^{2} x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} c^{2} n^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 5 \, b^{3} c^{2} n x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 6 \, a b^{2} c d n x e^{\left (n{\rm ln}\left (b x + a\right )\right )} - 2 \, a^{2} b d^{2} n x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 6 \, b^{3} c d x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 5 \, a b^{2} c^{2} n e^{\left (n{\rm ln}\left (b x + a\right )\right )} - 2 \, a^{2} b c d n e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 6 \, b^{3} c^{2} x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 6 \, a b^{2} c^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} - 6 \, a^{2} b c d e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, a^{3} d^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )}}{b^{3} n^{3} + 6 \, b^{3} n^{2} + 11 \, b^{3} n + 6 \, b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)^2*(b*x + a)^n,x, algorithm="giac")

[Out]

(b^3*d^2*n^2*x^3*e^(n*ln(b*x + a)) + 2*b^3*c*d*n^2*x^2*e^(n*ln(b*x + a)) + a*b^2
*d^2*n^2*x^2*e^(n*ln(b*x + a)) + 3*b^3*d^2*n*x^3*e^(n*ln(b*x + a)) + b^3*c^2*n^2
*x*e^(n*ln(b*x + a)) + 2*a*b^2*c*d*n^2*x*e^(n*ln(b*x + a)) + 8*b^3*c*d*n*x^2*e^(
n*ln(b*x + a)) + a*b^2*d^2*n*x^2*e^(n*ln(b*x + a)) + 2*b^3*d^2*x^3*e^(n*ln(b*x +
 a)) + a*b^2*c^2*n^2*e^(n*ln(b*x + a)) + 5*b^3*c^2*n*x*e^(n*ln(b*x + a)) + 6*a*b
^2*c*d*n*x*e^(n*ln(b*x + a)) - 2*a^2*b*d^2*n*x*e^(n*ln(b*x + a)) + 6*b^3*c*d*x^2
*e^(n*ln(b*x + a)) + 5*a*b^2*c^2*n*e^(n*ln(b*x + a)) - 2*a^2*b*c*d*n*e^(n*ln(b*x
 + a)) + 6*b^3*c^2*x*e^(n*ln(b*x + a)) + 6*a*b^2*c^2*e^(n*ln(b*x + a)) - 6*a^2*b
*c*d*e^(n*ln(b*x + a)) + 2*a^3*d^2*e^(n*ln(b*x + a)))/(b^3*n^3 + 6*b^3*n^2 + 11*
b^3*n + 6*b^3)